<include file="public@header"/>
</head>
<body>
<div class="layui-fluid js-check-wrap">
    <div class="layui-card">
        <div class="layui-card-header">
            <h3>{:lang('PORTAL_ADMINPAGE_INDEX')}</h3>
        </div>
        <div class="layui-card-body">
            <form class="well form-inline margin-top-20 clearfix" action="{:url('AdminPage/index')}">
                <div class="layui-col-md11 layui-col-sm10">
                    <div class="layui-inline">
                        <input type="text" class="layui-input" name="keyword" style="width: 160px;"
                           value="{$keyword|default=''}" placeholder="{:lang('PLEASE_ENTER_KEYWORD')}">
                    </div>
                    <div class="layui-inline">
                        <button class="layui-btn layui-btn-normal">搜索</button>
                    </div>
                </div>

                <div class="layui-col-md1 layui-col-sm2">
                    <a class="layui-btn layui-btn-normal fr" href="{:url('AdminPage/add')}">{:lang('PORTAL_ADMINPAGE_ADD')}</a>
                </div>
            </form>
        </div>

        <form class="js-ajax-form" method="post">
            <table class="layui-table">
                <thead>
                <tr>
                    <th width="50" class="text-center">
                        <div class="custom-checkbox">
                            <input type="checkbox" id="checkall" class="js-check-all" data-direction="x" data-checklist="js-check-x">
                            <label for="checkall"></label>
                        </div>
                    </th>
                    <th width="100">ID</th>
                    <th>标题</th>
                    <th width="80">作者</th>
                    <th width="160">发布时间</th>
                    <!-- <th width="80">状态</th> -->
                    <th width="120">操作</th>
                </tr>
                </thead>
                <php>$status=array("1"=>'已发布',"0"=>'未发布');</php>
                <foreach name="pages" item="vo">
                    <tr>
                        <td class="text-center">
                            <div class="custom-checkbox">
                                <input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" id="chk_{$vo.id}"
                                   value="{$vo.id}" title="ID:{$vo.id}">
                                <label for="chk_{$vo.id}"></label>
                            </div>
                        </td>
                        <td>{$vo.id}</td>
                        <td>
                            <a href="{:url('portal/page/index',array('id'=>$vo['id']))}" target="_blank">
                                {$vo.post_title}
                            </a>
                        </td>
                        <td>{$vo.user_nickname}</td>
                        <td>
                            <empty name="vo.published_time">
                                未发布
                                <else/>
                                {:date('Y-m-d H:i',$vo['published_time'])}
                            </empty>
                        </td>
                        <!-- <td>
                            <notempty name="vo.post_status">
                                <a data-toggle="tooltip" title="已发布"><i class="fa fa-check"></i></a>
                                <else/>
                                <a data-toggle="tooltip" title="未发布"><i class="fa fa-close"></i></a>
                            </notempty>
                        </td> -->
                        <td>
                            <a class="layui-btn layui-btn-xs" href="{:url('AdminPage/edit',array('id'=>$vo['id']))}">{:lang('EDIT')}</a>
                            <a href="{:url('AdminPage/delete',array('id'=>$vo['id']))}" class="js-ajax-delete layui-btn layui-btn-danger layui-btn-xs">{:lang('DELETE')}</a>
                        </td>
                    </tr>
                </foreach>
            </table>

            <div class="pagination-row clearfix">
                <div class="layui-col-sm6 text-left-sm">
                    <!-- 删除选中项 -->
                    <button class="layui-btn layui-btn-danger js-ajax-submit" type="submit"
                            data-action="{:url('AdminPage/delete')}" data-subcheck="true" data-msg="您确定删除吗？">
                        {:lang('DELETE_SELECTED')}
                    </button>
                </div>
                
        
                <div class="pages">{$page|default=''}</div>
            </div>
        </form>
    </div>
</div>

<include file="public@footer"/>
